package cn.how2go.data.service.impl;

import cn.how2go.data.entity.Cars;
import cn.how2go.data.mapper.CarsMapper;
import cn.how2go.data.service.CarsService;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2019/7/15.
 */
@Service
public class CarsServiceImpl extends ServiceImpl<CarsMapper, Cars> implements CarsService {
    @Autowired
    private CarsMapper carsMapper;
    @Override
    public Cars findCarsBySimno(String simno) {
        EntityWrapper<Cars> entityWrapper = new EntityWrapper<>();
        entityWrapper.eq("simno",simno);
        List<Cars> list = carsMapper.selectList(entityWrapper);
        if(list!=null && list.size()>0)
            return list.get(0);
        return null;
    }
}
